<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改车辆-信息')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-info-edit" th:object="${carInfo}">
            <input name="carInfoId" th:field="*{carInfoId}" type="hidden">
            <input name="carId" th:field="*{carId}" type="hidden">
            <input name="menuId" th:field="*{menuId}" type="hidden">
            <input name="configType" th:field="*{configType}" type="hidden">
            <input id="car_info" name="info" th:field="*{info}" type="hidden">

            <div class="row clearfix">
                <div class="col-sm-2 column">
                    预览图片
                    <ul class="list-group" id="left_img_list"></ul>
                </div>
                <div class="col-sm-10 column">
                    <div class="row clearfix">
                        <div class="col-md-12 column">
                            <th:block class="form-group" th:if="${carInfo.carInfoId!=null}">
                                <label class="col-sm-1 control-label">图片</label>
                                <div class="col-sm-11" th:include="system/common/file_select :: multiple_img(_file_id='multipleFile',_img_list_id='left_img_list',_file_list=${@file.getFiles(carInfo.carId,carInfo.configType)})"/>
                            </th:block>
                        </div>
                    </div>

                    <div class="row clearfix" style='vertical-align: middle;text-align: center'>
                        <div class="form-group">
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'zq_45')">左前45°</span></h1>
                            </div>
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'zq_f')">正前方</span></h1>
                            </div>
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'yq_45')">右前45°</span></h1>
                            </div>
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'zc')">左侧</span></h1>
                            </div>
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'yc')">右侧</span></h1>
                            </div>
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'zh_f')">正后方</span></h1>
                            </div>
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left_rear_45')">左后45°</span></h1>
                            </div>
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'right_rear_45')">右后45°</span></h1>
                            </div>
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front_45')">前45°特写</span></h1>
                            </div>
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front_face')">前脸特写</span></h1>
                            </div>
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front_face_left_front_45')">前脸左前45°特写</span></h1>
                            </div>
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front_windshield_left_front_45')">前挡左前45°特写</span></h1>
                            </div>
                            <div class="col-sm-2 column">
                                <h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back_45')">后45°特写</span></h1>
                            </div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'trunk')">后备箱特写</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'trunk_right_back_45')">后备箱右后45°特写</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back_windshield_right_back_45')">后挡右后45°特写</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front_suspension')">前悬挂</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front_tire')">前轮胎</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back_suspension')">后悬挂</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back_tire')">后轮胎</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'gas_station')">加油口</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'charging_port1')">充电口1</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'charging_port2')">充电口2</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'roof')">车顶</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left_front_cover_open_45')">左前45°机盖开启</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front_cover_open_45')">正前机盖开启</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left_front_cover_open_45_t')">左前45°机盖开启特写</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'cover_hinge_brace_t')">机盖铰链撑杆特写</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'right_back_luggage_cover_open_45')">右后45°行李盖开启</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back_luggage_cover_open')">正后行李盖开启</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'right_back_luggage_cover_open_45_t')">行李盖开启特写</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'luggage_cover_hinge_brace_t')">行李盖铰链撑杆特写</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front_door_open_front')">前车门开启前正视图</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front_door_open_back')">前车门开启后正视图</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back_door_open_front')">后车门开启前正视图</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back_door_open_back')">后车门开启后正视图</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back_door_open_45')">后车门开启45°</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'rearview_mirror')">后视镜</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'rearview_mirror_left_front_45')">后视镜左前45°</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'rearview_mirror_left_back_45')">后视镜左后45°</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'door_handle')">门把手特写</span></h1></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">备注：</label>
                        <div class="col-sm-8">
                            <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"></label>
                        <div class="col-sm-8"><button type="button" class="btn btn-success" onclick="submitHandler()">上传</button></div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-select-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/car/info";
        $("#form-info-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                let json=$('#form-info-edit').serializeJson();
                console.log(json)
                $('#car_info').val(JSON.stringify(json.infoMap)||'{}');
                let serialize = $('#form-info-edit').serialize();
                console.log(serialize)
                // console.log(JSON.stringify($('#form-info-edit').serializeJson()))
                // return;
                $.operate.save(prefix + "/edit?_="+Math.random(), serialize);
            }
        }
        $(function (){
            multipleFile_manager.init({busId: [[${carInfo.carId}]], busType: [[${carInfo.configType}]], fileType: 'img'});
        });
    </script>
</body>
</html>